<template>
	<view class="li-item">
		<view class="li-item">
			<view class="li-item-img"><image :src="item.listPicture.length!=0 ? https+item.listPicture[0].picturePath : '../../static/zwtp1.jpg' " mode="scaleToFill"></image>
			<image src="../../static/jy.png" mode="" class="jy" v-if="item.isReport!=0 "></image>
			</view>
			<view class="li-item-cont">
				<view class="li-item-cont-title">{{ item.modelName }}</view>
				<!-- <view class="li-item-cont-bq">{{ item.carRegistrationTime  }}上牌/{{ item.mileage }}万公里/{{ item.cityName }}</view> -->
				<view class="li-item-cont-bq">{{item.carAge}}年/{{ item.mileage }}万公里/{{ item.cityName }}</view>
				<view class="li-item-cont-text-r" v-if="item.isReport!=0 ">
					<text>已检测</text>
				</view>
				<view class="li-item-cont-text">
					<!-- <text class="li-item-cont-text-time">{{ item.platformName }} {{ item.releaseTime | changeDates(5,10) }}</text> -->
					<text class="li-item-cont-text-w">{{ item.sellingPrice }}万</text>
					
					<view class="li-item-cont-money"> <image src="../../static/gu.png" mode=""></image> {{ item.platformEstimatedPrice }}万
					<!-- <text>性价比</text>{{ item.costPerformance }}% -->
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import API from "@/api/index.js"
	export default {
		name:"tab-item",
		props:{
			item:{
				type: Object,
				default(){
					return {}
				}
			}
		},
		data() {
			return {
				https: getApp().globalData.picturePath,
			};
		},
		methods:{
			goReport(item){
				console.log(item)
				let data = {
						cityId: item.cityId,
						brandId: item.brandId,
						seriesId: item.seriesId,
						modelId: item.modelId,
						regDate: item.carRegistrationTime.substring(0,10),
						mile: item.mileage,
						fullyChargedEndurance: item.rechargeMileage
					}
					API.getFastValuation(data).then(res=>{
						if(res.code==200){
							uni.navigateTo({
								url:`/pagesA/assessment/mianfeiReportDetail?data=${encodeURIComponent(JSON.stringify(res.data))}`
							})
						}else{
							if(res.message == 'token验证失效'){
								res.message ="未登录"
							}
							this.$u.toast(res.message || '请求失败');
						}
					})
			}
		}
	}
</script>

<style scoped lang="scss">
	.li-item{
		// display:-webkit-box;;
		display: flex;
		
	
		.li-item-img{
			position: relative;
			width: 260rpx;
			height: 198rpx;
			margin-right: 26rpx;
			// margin-top:10rpx;
			image{
				width: 100%;
				height: 100%;
				border-radius: 3px;
			}
			.jy{
				width: 44rpx;
				height: 50rpx;
				position: absolute;
				top: -4rpx;
				left: 12rpx;
			}
		}
		.li-item-cont{
			// flex: 1;
			width: 420rpx;
			.li-item-cont-title{
				font-family: PingFangSC-Regular;
				font-size: 30rpx;
				max-height: 85rpx;
				color: #323232;
				line-height: 40rpx;
				font-weight: 550;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
	
			}
			.li-item-cont-bq{
				margin-top: 10rpx;
				font-size: 24rpx;
				color: #999999;
				    overflow: hidden;
				    text-overflow: ellipsis;
				    white-space: nowrap;
			}
			
			.li-item-cont-text{
				display: flex;
				align-items: center;
				font-size: 28rpx;
				// margin-top: 10rpx;
				.li-item-cont-text-time{
					font-size: 24rpx;
					color: #666;
				}
				.li-item-cont-text-w{
					font-size: 34rpx;
					color: #FF552E;
					margin-top: 10rpx;
					font-weight: 550;
					width: 140rpx;
				}
				
				.cjbg{
					width: 23rpx;
					height: 23rpx;
					padding: 9rpx 10rpx 5rpx 25rpx;
				}
				.cjbg1{
					width: 8rpx;
					height: 12rpx;
					padding: 15rpx 10rpx 0;
				}
			}
		}
	}
	.li-item-cont-text-r{
		width: 102rpx;
		height: 39rpx;
		line-height: 39rpx;
		font-size: 24rpx;
		color: #fff;
		background: #5789FD;
		margin-top: 15rpx;
		text-align: center;
	}
	.li-item-cont-money{
		display: flex;
		margin-top: 20rpx;
		font-size: 24rpx;
		color: #FF552E;
		height: 43rpx;
		line-height: 43rpx;
		image{
			width: 22.5rpx;
			height: 22.5rpx;
			margin-top: 8rpx;
			margin-right: 8rpx;
		}
		}
	
</style>
